﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/bug/Bug.master" AutoEventWireup="true" CodeFile="BugUnAssignment.aspx.cs" Inherits="admin_bug_BugAssignment" %>

<%@ MasterType VirtualPath="~/admin/bug/Bug.master" %>
<%@ Reference VirtualPath="~/admin/Admin.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="SettingHeading" runat="Server">
    View Bug Unassignment <span class="vtip a-tooltip" title="View users currently assign to each bug of one project here. To Assign, use <strong>Assign Bug</strong>"></span>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TheForm" runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $('.quick-bug-assignment').click(function () {
                $('#TheForm_TheForm_txtBugId').val($(this).attr('title'));
                $('#bug-id').text($(this).attr('title'));
                $('#TheForm_TheForm_ddlUser').html($(this).html());
            });

            // pop up quick overview using fancy box
            $(".quick-bug-assignment").fancybox({
                'titleShow': false,
                'transitionIn': 'fade',
                'transitionOut': 'none',
                'href': '#quick-bug-assignment'
            });

        });
    </script>
    <!-- quick overview message here -->
    <div class="hide">
        <div id="quick-bug-assignment">
            <asp:TextBox ID="txtBugId" runat="server" Visible="False"></asp:TextBox>
            <!-- Project Name -->
            <div class="a-field">
                <h2>Unassign Users from Bug ID <span id="bug-id"></span></h2>
                Please choose a username from the list below
                <asp:DropDownList ID="ddlUser" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlUser_SelectedIndexChanged" Style="width: 100%; margin: 20px 0;">
                </asp:DropDownList>
            </div>
        </div>
    </div>
    <div class="a-field" id="viewimg-bug-admin-page">
        <span style="float: left; margin: 7px 0 0 -128px; font-weight: bold;">Project Name</span>
        <div class="a-select">
            <asp:DropDownList ID="ddlProjectName" runat="server" AutoPostBack="True" placeholder="Choose a project" OnSelectedIndexChanged="ddlProjectName_SelectedIndexChanged">
            </asp:DropDownList>
        </div>
    </div>
    <div id="bug-list-view-admin">
        <asp:ListView ID="lvView" runat="server">
            <EmptyDataTemplate>
                <p>Relax now, no bugs found!</p>
            </EmptyDataTemplate>
            <LayoutTemplate>
                <div id="ticket_filter_list_header" class="ticket_filter_list_header">
                    <span class="ticket_filter_item_tv_type" style=""></span><span class="ticket_filter_item_tv_customer_name">ID </span><span class="ticket_filter_item_tv_subject">Summary </span><span class="ticket_filter_item_tv_message_count scrollbar_mover">
                        <img alt="" class="agent_icon_button" src="/images/refresh.png" />
                    </span><span class="ticket_filter_item_tv_status scrollbar_mover">Status </span><span class="ticket_filter_item_tv_priority scrollbar_mover">
                        <img alt="" class="agent_icon_button" src="/images/label.png" style="margin-left: 2px;" />
                    </span><span class="ticket_filter_item_tv_updated scrollbar_mover">Updated </span><span class="ticket_filter_item_tv_actions scrollbar_mover">Username</span>
                </div>
                <div id="ticket_filter_list_items_outer_div" class="ticket_filter_list_items table_view">
                    <div id="ticket_filter_list_items_data_div">
                        <div id="ticket_filter_list_items">
                            <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                        </div>
                        <div id="ticket_filter_item_paginator">
                            Page
                            <asp:DataPager ID="DataPager" PageSize="10" runat="server">
                                <Fields>
                                    <asp:NumericPagerField ButtonCount="10" PreviousPageText="«" NextPageText="»" />
                                </Fields>
                            </asp:DataPager>
                        </div>
                    </div>
                </div>
            </LayoutTemplate>
            <ItemTemplate>
                <!-- first item, selected -->
                <div class="ticket_filter_item ticket_filter_item_table_view">
                    <!-- bug type image -->
                    <span class="ticket_filter_item_tv_type">
                        <img alt="" title="<%# EnumUtility.GetEnumNiceName((BugManagement.Type)Eval("Type")) %>" class="agent_icon_button vtip" src="/images/bug/type/<%# Eval("Type") %>.png" />
                    </span>
                    <!-- bug ID -->
                    <div class="ticket_filter_item_tv_customer_name">
                        <a href="/Bug.aspx?id=<%# Eval("BugId") %>" title="Click to view bug details">
                            <%# Eval("BugId") %>
                        </a>
                    </div>
                    <!-- bug severity -->
                    <div class="ticket_filter_item_tv_subject">
                        <div class="ticket_filter_item_data ticket_filter_item_tv_labels">
                            <ul class="token-input-list-facebook bug-severity">
                                <li class="token-input-token-facebook bug-severity-<%# EnumUtility.GetEnumNiceName((BugManagement.Severity)Eval("Severity")) %>">
                                    <p title="Severity level of this bug">
                                        <%# EnumUtility.GetEnumNiceName((BugManagement.Severity)Eval("Severity")) %>
                                    </p>
                                </li>
                            </ul>
                        </div>
                        <!-- bug summary -->
                        <a href="#" class="vtip" title="<%# Eval("Description") %>">
                            <%# Eval("Summary").ToString().Length < 100 ? Eval("Summary") : Eval("Summary").ToString().Substring(0, 99) %>
                        </a>
                    </div>
                    <!-- comment count -->
                    <span class="lesser_data ticket_filter_item_tv_message_count">
                        <img alt="" title="Reproducability: <%# EnumUtility.GetEnumNiceName((BugManagement.Reproducability)Eval("Reproducability")) %>" class="agent_icon_button vtip" src="/images/bug/repro/<%# Eval("Reproducability") %>.png" />
                    </span>
                    <!-- status -->
                    <span class="lesser_data ticket_filter_item_tv_status" style="margin-top: 1px"><span class="ticket_filter_item_status_box bug_status_<%# EnumUtility.GetEnumNiceName((BugManagement.ShortStatus)Eval("Status"))%>"><span class="ticket_filter_item_data">
                        <%# EnumUtility.GetEnumNiceName((BugManagement.ShortStatus)Eval("Status")) %>
                    </span></span></span>
                    <!-- priority -->
                    <span class="lesser_data ticket_filter_item_tv_priority"><span style="float: right; margin-top: 0;">
                        <img alt="" title="Priority: <%# EnumUtility.GetEnumNiceName((BugManagement.Priority)Eval("Priority")) %>" class="agent_icon_button vtip" src="/images/bug/priority/<%# Eval("Priority") %>.png" style="margin-top: -3px; margin-right: 0pt;" height="16" width="16" />
                    </span></span>
                    <!-- last updated -->
                    <span class="lesser_data ticket_filter_item_time ticket_filter_item_tv_updated">
                        <%# (DateTime.Now - (DateTime)(Eval("LastUpdatedDate"))).TotalHours > 24 ? ((DateTime.Now - (DateTime)(Eval("LastUpdatedDate"))).Days == 1 ? "1 day ago" : (DateTime.Now - (DateTime)(Eval("LastUpdatedDate"))).Days.ToString() + " days ago") : ((DateTime.Now - (DateTime)(Eval("LastUpdatedDate"))).Hours == 1 ? "1 hour ago" : (DateTime.Now - (DateTime)(Eval("LastUpdatedDate"))).Hours.ToString() + " hours ago") %>
                    </span>
                    <!-- version -->
                    <span class="lesser_data ticket_filter_item_tv_assigned_2">
                        <asp:DropDownList Width="100px" class="a-select quick-bug-assignment" ID="ddlUser" DataValueField="Fullname" DataTextField="Username" DataSource='<%# Eval("userList") %>' title='<%# Eval("BugId") %>' runat="server">
                        </asp:DropDownList>
                    </span>
                    <%--           <asp:DropDownList ID="DropDownList1" runat="server">
                            <asp:ListItem>helllo1</asp:ListItem>
                            <asp:ListItem>here</asp:ListItem>
                        </asp:DropDownList></span>cket_filter_item_tv_actions" style="margin-top: 2px;"><a title="Open In New Window"
                        class="ticket_filter_item_tv_tip_open ticket_filter_action_open" href="/Bug.aspx?id=<%# Eval("BugId") %>"
                        target="_blank">
                        <asp:DropDownList ID="DropDownList1" runat="server">
                            <asp:ListItem>helllo1</asp:ListItem>
                            <asp:ListItem>here</asp:ListItem>
                        </asp:DropDownList></span>--%>
                </div>
            </ItemTemplate>
        </asp:ListView>
    </div>
</asp:Content>